
/*******  for plan script *******/

var _ge=function(id)
{
	el=document.getElementById(id);
	return el;
};

// call by function 9
var insitu_saveChanges=function(_12)
{
	var div1=_ge("description_div"+_12);
	div1.innerHTML="正在保存，请稍候...&nbsp;";
	insitu_endEditing(_12);

};


var insitu_endEditing=function(_12){
	var _51=_ge("description_div"+_12);
	var _52=_ge("textarea_div"+_12);
	_52.style.display="none";
	_51.style.display="block";
		
  };


// call by function 9
var insitu_init_generic_description_div=function(_12)
{
	var div=_ge("description_div"+_12);
	div.title="点击编辑";

	return insitu_init_editable_div(div,_12);
};

// call by func insitu_init_generic_description_div
var insitu_init_editable_div=function(div,_12)
{
 div.startEditing=function(){
	  this.isEditing=true;
	  this.unhighlight();
	  this.style.display="none";
	  var _32=_ge("textarea_div"+_12);
	  _32.style.display="block";
	  //var _33=_32.firstChild;
	  var _33=_ge("content"+_12);
	  _33.focus();
	  _33.select();
  };

 div.onclick=div.startEditing;

 div.onmouseover=function()
 {
	 this.highlight();
 };

 div.onmouseout=function()
 {
		if(this.hideTimer)
		{
			clearTimeout(this.hideTimer);
		}
		this.hideTimer=setTimeout("var el = document.getElementById(\""+this.id+"\"); if (el) el.unhighlight()",1000);
  };

 div.highlight=function(){
	   if(this.hideTimer)
	   {
		   clearTimeout(this.hideTimer);
	   }
	   div.style.backgroundColor="#ffffd3";
	   if(this.emptyText&&(div.innerHTML=="&nbsp;"||div.innerHTML==" "||div.innerHTML.charCodeAt(0)==160))
	   {
		   div.style.color="#888";
		   div.innerHTML=this.emptyText;
	   }
  };

 div.unhighlight=function()
 {
	 if(this.hideTimer)
	 {
		 clearTimeout(this.hideTimer);
	 }
	 div.style.backgroundColor="";
	 if(this.emptyText&&div.innerHTML.toUpperCase()==this.emptyText.toUpperCase())
	 {
		 div.innerHTML="&nbsp;";
		 div.style.color="#000";
	 }
 };
 return div;
};